<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>销售模块-销售产品</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>
	<style type="text/css">
		.xyg-ul{width: 100%; height: auto;}
		.xyg-ul .xyg-list{width: 19%; margin: 10px 0.5%; height: auto; float: left; background: #e4e4e4;}
		.xyg-ul .xyg-list .xyg-list-img{width: 98%; margin: 2px 1%; height: 200px;}
		.xyg-ul .xyg-list .xyg-list-img img{width: 100%;height: 100%;}
		.xyg-ul .xyg-list .xyg-list-desc{width: 100%; text-align: center; height: 40px; line-height: 40px;}
	</style>
<body class="childrenBody">
<form class="layui-form">
	<blockquote class="layui-elem-quote quoteBox" id="tool">
		<div class="layui-inline">
			<label class="layui-input-inline">名称</label>
			<label class="layui-input-inline">
				<input type="text" class="layui-input" id="name" name="name" placeholder="请输入名称" /></label>
			<label class="layui-input-inline">所属分类</label>
			<label class="layui-input-inline">
				<select name="colId" id="colId"></select>
			</label>
			<a class="layui-btn search_btn" id="search">搜索</a></div>
	</blockquote>
	<ul class="xyg-ul" id="showContent">

	</ul>
</form>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">layui.use(['jquery', 'baseUtil', 'pageUtil'],
    function() {
        var $ = layui.jquery,
            pageUtil = layui.pageUtil,
            baseUtil = layui.baseUtil;
        pageUtil.initDictByUrl("/saleColumn/acceptSelect","sale_column_type",function (dictDataUrl) {
            pageUtil.showDict($("#colId"), pageUtil.aceeptDictContentList(dictDataUrl, "sale_column_type"), "请选择所属分类");
        });
        initData();
        $("#search").bind("click",function () {
            initData();
        })

        function initData() {
            $("#showContent").html("");
            baseUtil.postMethodResult("/saleProduct/list",{"name":$("#name").val(),"colId":$("#colId").val()},function (data) {
                data.forEach(function (item,index) {
                    $("#showContent").append('<li class="xyg-list">'+
                        '<a href="/saleProduct/getEntity?id='+item.id+'&page=saleProductUserDesc">'+
                        '<div class="xyg-list-img">'+
                        '<img src="'+item.thumImage+'">'+
                        '</div>'+
                        '<div class="xyg-list-desc">'+item.name+'</div>'+
                        '</a>'+
                        '</li>');
                })
            });
        }

    })</script>
</body>

</html>